<html><head><title>AddGadgetColumn</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">AddGadgetColumn()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#3A3966"><b>AddGadgetColumn</b></font>(#Gadget, Position, Title$, Width)</blockquote>

<b>Description</b><br><blockquote>

Adds a new column to the specified gadget. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
The gadget to use. 

</td></tr>
<tr><td><i>Position</i></td>
<td> 
The column index where the new 
item should be inserted. Column indexes start from 0, which is the leftmost column, and increase 
by 1 for each column to the right. When you add a column, all the old columns which are on the right 
of the new column will have a position which is one more than they previously had. 

</td></tr>
<tr><td><i>Title$</i></td>
<td> 
The text for the column header. 

</td></tr>
<tr><td><i>Width</i></td>
<td> 
The initial width of the new column. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Remarks</b></p><blockquote>

This command can be used with the following types of gadgets: 
<br>
<br>
- <a href="listicongadget.html">ListIconGadget()</a> 
<br>
- <a href="explorerlistgadget.html">ExplorerListGadget()</a> 
<br>
<br>
For <a href="explorerlistgadget.html">ExplorerListGadget()</a> you can use this function to completely customize the information that 
the gadget displays, by first removing the standard columns with <a href="removegadgetcolumn.html">RemoveGadgetColumn()</a> and adding 
new ones of your choice. Note that the 'Name' column doesn't need to be the first one in the gadget. 
<br>
Note: To update the gadget contents after you have added new columns, use <a href="setgadgettext.html">SetGadgetText()</a>. 
To fill in a custom column, use <a href="setgadgetitemtext.html">SetGadgetItemText()</a> for each item, after you have received a 
<font color="#924B72">#PB_EventType_Change</font> event for the gadget. 
<br>
When adding a column, use one of the following constants in the Title$ field to create a column whose 
contents will be automatically updated by the gadget, or use any title string you wish to create an 
empty column which you can then fill with <a href="setgadgetitemtext.html">SetGadgetItemText()</a>. 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Explorer_Name</font>       : displays the name of the file/directory
  <font color="#924B72">#PB_Explorer_Size</font>       : displays the filesize in Kb
  <font color="#924B72">#PB_Explorer_Type</font>       : displays a string describing the filetype
  <font color="#924B72">#PB_Explorer_Attributes</font> : displays the attributes of the file/directory
  <font color="#924B72">#PB_Explorer_Created</font>    : displays the time the file/directory was created
  <font color="#924B72">#PB_Explorer_Modified</font>   : displays the time the file/directory was last modified
  <font color="#924B72">#PB_Explorer_Accessed</font>   : displays the time the file/directory was last accessed
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 150, &quot;ListIcon - Add Columns&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    ListIconGadget</font>(0, 10, 10, 380, 100, &quot;Standard Column&quot;, 150, <font color="#924B72">#PB_ListIcon_GridLines</font>)
<font color="#3A3966">    ButtonGadget</font>(1, 10, 120, 150, 20, &quot;Add new column&quot;)
    index = 1     <font color="#3A3966">; &quot;Standard column&quot; has already index 0</font>
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
      <b><font color="#3A3966">If</font></b> Event = <font color="#924B72">#PB_Event_Gadget</font>
        <b><font color="#3A3966">If</font></b> <font color="#3A3966">EventGadget</font>() = 1
<font color="#3A3966">          AddGadgetColumn</font>(0, index, &quot;Column &quot;+<font color="#3A3966">Str</font>(index), 80)
          index + 1
        <b><font color="#3A3966">EndIf</font></b>
      <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="removegadgetcolumn.html">RemoveGadgetColumn()</a>, <a href="listicongadget.html">ListIconGadget()</a>, <a href="explorerlistgadget.html">ExplorerListGadget()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><a href="index.html">Gadget Index</a> - <a href="addgadgetitem.html">AddGadgetItem()</a> -><br><br>

</body></html>